package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-05-15
 * Time: 20:59
 */
public class Animal {
    public String name;
    public int age;
    public String gender;

    public Animal(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        System.out.println("Animal.构造方法执行中......");
    }

    static{
        System.out.println("Animal.静态代码块执行中......");
    }

    {
        System.out.println("Animal.实例代码块执行中......");
    }

    public Animal() {
    }

    public void eat(){
        System.out.println(name + " 正在吃饭!");
    }
}
